#ifndef TASKTYPE_H
#define TASKTYPE_H

#include "itemType.h"
#include "defs.h"

#include <QTextStream>
#include <QString>
#include <QDate>
#include <QFile>

class taskType : public itemType
{
public:
    taskType();

    //getters
    QString getName()   { return getField( 0 ); }
    QDate   getDate()   { return QDate::fromString( getField( 1 ) ); }
    QString getAlgorithm() {
        //QString s = getField(2).toInt();
        //if ()
        //return algo[ getField(2).toInt() ];
        return getField(2);
    }
    QString getOptimization() {
        //return optim[ getField(3).toInt() ];
        return getField(3);
    }

    //setters
    void    setName( const QString& name ) { setField(0, name); }
    void    setDate( const QDate& date )   { setField(1, date.toString() ); }
    void    setAlgorithm( int alg )        { setField(2, algo[ alg ] ); }
    void    setOptimization( int opt )     { setField(3, optim[ opt ] ); }

    QVector< QVector<int> > input;
    QVector< QVector<int> > output;

    void setByItemType( itemType& item );
    void loadInputFromFile( const QString &fileName );
    void loadOutputFromFile( const QString &fileName );
};

#endif // TASKTYPE_H
